http object

This method retrieves any new data from a currently active download using either the get or post methods.

string request()

Parameters:
None.

Return value:
The data from the server on success, or a blank string on failure.

Remarks:
This method checks if any new data has been returned by the server since the last call, and returns it as a string. It must be called continuously, without any long pauses, if the retrieval is to succeed. You must keep calling this function until the progress boolean property reports false.

Please note that it is perfectly normal for this method to return a blank string without any error having occured. This simply means that no new data was provided by the server since the last call. Always call get_last_error to detect if an actual error has occured.

Example:
// Retrieve the contents of the index page at blastbay.com.

void main()
{
http download;
string body=download.get("http://www.blastbay.com/");
if(get_last_error()!=0)
{
alert("Error", "An error occured.\r\nDescription: " + body + "");
}
else
{
while(download.progress)
{
body+=download.request();
wait(5);
}
clipboard_copy_text(body);
alert("Success", "The data was retrieved and has been copied to your clipboard.");
}
}